package com.yunkeji.admin.controller.statistics;

import cn.dev33.satoken.annotation.SaCheckPermission;
import com.yunkeji.common.core.controller.BaseController;
import com.yunkeji.common.core.domain.PageQuery;
import com.yunkeji.common.core.page.TableDataInfo;
import com.yunkeji.dao.vo.MonthStatisticsVo;
import com.yunkeji.dao.vo.StatisticsVo;
import com.yunkeji.system.domain.bo.MonthStatisticsBo;
import com.yunkeji.system.domain.bo.StatisticsBo;
import com.yunkeji.system.service.IPayDetailService;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 业务统计
 *
 * @author 雷擎宇
 * @date 2024-11-19
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/system/statistics")
public class StatisticsController extends BaseController {

    private final IPayDetailService payDetailService;

    /** 查询每日注册充值统计列表 */
    @SaCheckPermission("system:statistics:list")
    @GetMapping("/list")
    public TableDataInfo<StatisticsVo> list(StatisticsBo bo, PageQuery pageQuery) {
        return payDetailService.queryStatistics(bo, pageQuery);
    }

    /** 查询月总充值统计列表 */
    @SaCheckPermission("system:statistics:month")
    @GetMapping("/month")
    public TableDataInfo<MonthStatisticsVo> month(MonthStatisticsBo bo, PageQuery pageQuery) {
        return payDetailService.queryMonthStatistics(bo, pageQuery);
    }

//    /** 导出注册充值统计列表 */
//    @SaCheckPermission("system:statistics:export")
//    @Log(title = "导出注册充值统计列表", businessType = BusinessType.EXPORT)
//    @PostMapping("/export")
//    public void export(LikeWallBo bo, HttpServletResponse response) {
//        List<LikeWallVo> list = iLikeWallService.queryList(bo);
//        ExcelUtil.exportExcel(list, "贴贴墙", LikeWallVo.class, response);
//    }

}
